Clover coverage report - Enterprise Web Services - 1.0
Coverage timestamp: Mon May 30 2005 17:10:32 CEST
file stats: LOC: 68   Methods: 2
NCLOC: 35   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
HandlerGenerator.java 70% 100% 100% 87%
coverage coverage
 1   
 /*
 2   
  * Copyright 2001-2004 The Apache Software Foundation.
 3   
  * 
 4   
  * Licensed under the Apache License, Version 2.0 (the "License");
 5   
  * you may not use this file except in compliance with the License.
 6   
  * You may obtain a copy of the License at
 7   
  * 
 8   
  *      http://www.apache.org/licenses/LICENSE-2.0
 9   
  * 
 10   
  * Unless required by applicable law or agreed to in writing, software
 11   
  * distributed under the License is distributed on an "AS IS" BASIS,
 12   
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13   
  * See the License for the specific language governing permissions and
 14   
  * limitations under the License.
 15   
  */
 16   
 
 17   
 package org.apache.geronimo.ews.ws4j2ee.toWs.handlers;
 18   
 
 19   
 import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
 20   
 import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFHandler;
 21   
 import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
 22   
 import org.apache.geronimo.ews.ws4j2ee.toWs.Generator;
 23   
 import org.apache.geronimo.ews.ws4j2ee.toWs.Writer;
 24   
 
 25   
 import java.util.HashMap;
 26   
 
 27   
 /**
 28   
  * <p>Genarate the signature of the handlers as given by the webservices.xml file.</p>
 29   
  *
 30   
  * @author Srinath Perera(hemapani@opensource.lk)
 31   
  */
 32   
 public class HandlerGenerator implements Generator {
 33   
     private J2EEWebServiceContext j2eewscontext;
 34   
     private Writer[] writers = new Writer[0];
 35   
 
 36   
     private static HashMap handlermap = new HashMap();
 37   
 
 38   
     static {
 39  3
         handlermap.put("org.apache.ws.axis.security.CheckPoint4J2EEHandler",
 40   
                 "org.apache.ws.axis.security.CheckPoint4J2EEHandler");
 41   
     };
 42   
 
 43   
 
 44  15
     public HandlerGenerator(J2EEWebServiceContext j2eewscontext) throws GenerationFault {
 45  15
         this.j2eewscontext = j2eewscontext;
 46  15
         WSCFHandler[] handlers = j2eewscontext.getMiscInfo().getHandlers();
 47  15
         if (handlers != null) {
 48  15
             writers = new Writer[handlers.length];
 49  15
             for (int i = 0; i < handlers.length; i++) {
 50  2
                 if (!handlermap.containsKey(handlers[i].getHandlerClass())) {
 51  2
                     writers[i] = new HandlerWriter(j2eewscontext, handlers[i]);
 52   
                 }
 53   
             }
 54   
         }
 55   
     }
 56   
 
 57   
     /**
 58   
      * genarate the handlers
 59   
      */
 60  15
     public void generate() throws GenerationFault {
 61  15
         for (int i = 0; i < writers.length; i++) {
 62  2
             if (writers[i] != null) {
 63  2
                 writers[i].write();
 64   
             }
 65   
         }
 66   
     }
 67   
 }
 68